﻿using System;
using System.Web;
using Microsoft.Practices.Unity;

namespace WebShop.Infrastructure
{
    public class SingletonLifetimeManager<T> : LifetimeManager, IDisposable
    {
        static object service;

        public override object GetValue()
        {
            return service;
        }
        public override void RemoveValue()
        {
            service = null;
        }
        public override void SetValue(object newValue)
        {
            service = newValue;
        }
        public void Dispose()
        {
            RemoveValue();
        }
    }
}